package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;

public class dbMNG {
	private String db_url  = "jdbc:oracle:thin:@127.0.0.1:1521:XE";
	private String db_user = "hersniper";
	private String db_pw   = "1234";
	Connection conn = null;
	Statement stmt = null;
	PreparedStatement pstmt = null;
	ResultSet rs = null;
		
	public Connection getConn() throws Exception{
		Class.forName("oracle.jdbc.driver.OracleDriver");
		conn = DriverManager.getConnection(db_url,db_user,db_pw);
		return conn;
	}
	
	public void disConn() throws Exception{
		if(rs != null){
			rs.close();
		}
		
		if(stmt != null){
			stmt.close();
		}
		
		if(pstmt != null){
			pstmt.close();
		}
		 conn.close(); //추가했음
	}
	
	
}
